package day02;

public class panduanpaixu {
	public static void main(String[] args) {
		int[] x = { 2, 8, 10, 12, 33 };
		int[] y = { 2, 4, 3, 9, 10 };
		System.out.println(isSorted(x));
		System.out.println(isSorted(y));
	}

	public static boolean isSorted(int[] k) {
		int i;
		int flag = 0;
		int length = k.length;
		for (i = 0; i < length - 1; i++) {
			if (k[i] > k[i + 1]) {
				flag = 1;
			}
		}
		if (flag == 1)
			return false;
		else
			return true;
	}

}
